package android.framework.app.media;

import java.util.HashMap;

import android.app.ListActivity;
import android.content.Intent;
import android.framework.media.octo.Stream;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;

public class PlayListActivity extends ListActivity {

	private final String[] STREAM_NAMES = { "OCTO_DOMO", "OCTO_HANYA",
			"HLS_HANYA" };

	private HashMap<String, Stream> streams = new HashMap<String, Stream>();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		ArrayAdapter<String> adp = new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, android.R.id.text1,
				STREAM_NAMES);
		getListView().setAdapter(adp);
		getListView().setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				switch (position) {
				case 0:
					startActivity(new Intent().setClass(PlayListActivity.this,
							OctoListDemoActivity.class));
					break;

				case 1:
					startActivity(new Intent().setClass(PlayListActivity.this,
							OctoListHanyaActivity.class));
					break;

				case 2:
					startActivity(new Intent().setClass(PlayListActivity.this,
							HlsListHanyaActivity.class));
					break;
				}

			}
		});
	}

}
